Skip to content

Bound and test Reflex compatibility window - #475

Open
harsh21234i wants to merge 1 commit into
reflex-dev:mainfrom
harsh21234i:fix/reflex-compatibility-window-447
Open

Bound and test Reflex compatibility window#475
harsh21234i wants to merge 1 commit into
reflex-dev:mainfrom
harsh21234i:fix/reflex-compatibility-window-447

Conversation

@harsh21234i

@harsh21234i harsh21234i commented Aug 7, 2026

Copy link
Copy Markdown

Fixes #447

Summary

  • Bound xy[reflex] to the tested Reflex range >=0.9.6,<0.10.
  • Added CI compatibility coverage for Reflex 0.9.6 and 0.9.8.
  • Added component compilation and state-event rebuild smoke tests.
  • Updated CI and release installation checks.
  • Documented the supported compatibility window and release requirements.
  • Strengthened workflow verification to prevent untested Reflex versions.

Testing

  • Reflex 0.9.6: compatibility smokes passed.
  • Reflex 0.9.8: compatibility smokes passed.
  • tests/test_verify_ci_workflow.py: 94 passed.
  • CI, release, and CodSpeed workflow verification passed.

Review in cubic

Summary by CodeRabbit

  • Compatibility

    • Added support for Reflex versions 0.9.6 through 0.9.8.
    • Constrained the Reflex integration to versions 0.9.6 or later, but below 0.10, for more predictable deployments.
  • Documentation

    • Updated installation and deployment guidance with the supported Reflex version range.
    • Clarified that supported versions are verified through automated component and state-event checks.
  • Quality Improvements

    • Expanded release validation across supported Reflex versions and distribution formats.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request bounds the xy[reflex] dependency to >=0.9.6,<0.10. CI tests Reflex 0.9.6 and 0.9.8. Workflow validation and release smoke tests enforce the same bound.

Changes

Reflex compatibility window

Layer / File(s) Summary
Compatibility contract and release policy
pyproject.toml, docs/advanced/runtime-and-deployment.md, spec/process/production-readiness.md
The Reflex extra and documentation define >=0.9.6,<0.10. The release process documents endpoint testing and range expansion requirements.
CI compatibility matrix
scripts/verify_ci_workflow.py, .github/workflows/ci.yml
The required reflex_compatibility job tests Reflex 0.9.6 and 0.9.8. It validates package metadata and runs component and state smoke tests.
Release smoke-test bounds
.github/workflows/ci.yml, .github/workflows/release.yml, scripts/verify_ci_workflow.py
CI and release smoke environments require the bounded Reflex specification for wheel and sdist validation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CIWorkflow
  participant WorkflowValidator
  participant PackageMetadata
  participant CompatibilitySmokes
  CIWorkflow->>WorkflowValidator: validate reflex_compatibility matrix
  WorkflowValidator->>PackageMetadata: check xy[reflex] requirement
  CIWorkflow->>CompatibilitySmokes: run component and state tests on 0.9.6 and 0.9.8
Loading

Suggested reviewers: alek99, farhanaliraza

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: bounding and testing the supported Reflex compatibility window.
Linked Issues check ✅ Passed The changes satisfy issue #447 by bounding metadata, testing Reflex 0.9.6 and 0.9.8, updating documentation, and strengthening release checks.
Out of Scope Changes check ✅ Passed All changes support issue #447 by aligning dependency bounds, CI coverage, release validation, documentation, and workflow verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/verify_ci_workflow.py (1)

1153-1162: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Validate the bounded requirement in both coreless sdist smoke steps.

The coreless CI and release checks do not require REFLEX_REQUIREMENT. A future change can remove the upper bound from either coreless installation command without failing scripts/verify_ci_workflow.py.

  • scripts/verify_ci_workflow.py#L1153-L1162: require f'"{REFLEX_REQUIREMENT}"' in the CI coreless-sdist step.
  • scripts/verify_ci_workflow.py#L1364-L1373: require f'"{REFLEX_REQUIREMENT}"' in the release coreless-sdist step.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify_ci_workflow.py` around lines 1153 - 1162, The coreless sdist
smoke-step validation must enforce the bounded REFLEX_REQUIREMENT in both
locations. Update _require_step_contains at scripts/verify_ci_workflow.py lines
1153-1162 and 1364-1373 to require f'"{REFLEX_REQUIREMENT}"' for the CI and
release coreless-sdist steps, respectively.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

251-253: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Disable persisted checkout credentials.

actions/checkout stores the workflow token in local Git configuration by default. The later npm ci, package build, and test commands can read that credential. Set persist-credentials: false. No displayed step needs Git write access.

Proposed change
       - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
         with:
           fetch-depth: 0
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 251 - 253, Update the actions/checkout
step to set persist-credentials to false alongside fetch-depth, ensuring the
checkout token is not stored in local Git configuration.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/verify_ci_workflow.py`:
- Around line 888-897: Update the project metadata validation around
REFLEX_REQUIREMENT to parse pyproject.toml as TOML and inspect
project.optional-dependencies.reflex directly. Require that the reflex extra
exists and contains exactly REFLEX_REQUIREMENT, rejecting placements in other
dependency groups, base dependencies, comments, or additional reflex
requirements while preserving the existing read-error reporting.

---

Outside diff comments:
In `@scripts/verify_ci_workflow.py`:
- Around line 1153-1162: The coreless sdist smoke-step validation must enforce
the bounded REFLEX_REQUIREMENT in both locations. Update _require_step_contains
at scripts/verify_ci_workflow.py lines 1153-1162 and 1364-1373 to require
f'"{REFLEX_REQUIREMENT}"' for the CI and release coreless-sdist steps,
respectively.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 251-253: Update the actions/checkout step to set
persist-credentials to false alongside fetch-depth, ensuring the checkout token
is not stored in local Git configuration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 317d8e05-a228-443d-ae92-131597dd25f3

📥 Commits

Reviewing files that changed from the base of the PR and between 37c3d91 and 7491161.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • docs/advanced/runtime-and-deployment.md
  • pyproject.toml
  • scripts/verify_ci_workflow.py
  • spec/process/production-readiness.md

Comment on lines +888 to +897
try:
project_metadata = (ROOT / "pyproject.toml").read_text(encoding="utf-8")
except OSError as exc:
errors.append(f"cannot read project metadata for Reflex compatibility gate: {exc}")
else:
if f'"{REFLEX_REQUIREMENT}"' not in project_metadata:
errors.append(
"pyproject.toml must bound the xy[reflex] extra to "
f"{REFLEX_REQUIREMENT!r}"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Validate the reflex extra structurally.

Line 893 only searches for the requirement string in the full TOML text. It passes if the requirement moves to another extra, a base dependency, or a comment. Plain xy could then install Reflex, or xy[reflex] could omit it.

Parse pyproject.toml and require project.optional-dependencies.reflex to contain exactly REFLEX_REQUIREMENT.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify_ci_workflow.py` around lines 888 - 897, Update the project
metadata validation around REFLEX_REQUIREMENT to parse pyproject.toml as TOML
and inspect project.optional-dependencies.reflex directly. Require that the
reflex extra exists and contains exactly REFLEX_REQUIREMENT, rejecting
placements in other dependency groups, base dependencies, comments, or
additional reflex requirements while preserving the existing read-error
reporting.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/verify_ci_workflow.py">

<violation number="1" location="scripts/verify_ci_workflow.py:885">
P2: The new Reflex compatibility gate can pass with no active Reflex install or smoke tests because it searches the raw job text, including comments and inactive YAML, rather than executable named steps. Structural checks of the install and smoke-test steps would keep CI from silently losing this coverage.</violation>

<violation number="2" location="scripts/verify_ci_workflow.py:893">
P2: The metadata check does not prove that `xy[reflex]` is bounded: an unrelated occurrence of the exact requirement anywhere in `pyproject.toml` can make it pass. Parsing `project.optional-dependencies.reflex` and validating that entry directly would ensure the published extra, not a decoy string, stays within the tested window.</violation>
</file>

<file name="spec/process/production-readiness.md">

<violation number="1" location="spec/process/production-readiness.md:395">
P3: The new bounded Reflex contract (`reflex>=0.9.6,<0.10`) isn't propagated consistently in this file: the sdist release gate in the "Release-Blocking Gates" table (line ~92) still states the sdist `PKG-INFO` must include `reflex>=0.9.6` with no upper bound, contradicting the window introduced here. The confirming gate code also still fullmatches the unbounded form: `scripts/artifact_metadata.py` `_is_exact_reflex_extra` uses `re.fullmatch(r"\s*reflex\s*>=\s*0\.9\.6\s*;\s*extra...")` with no `,<0.10`, so it would reject the now-documented bounded `Requires-Dist: reflex>=0.9.6,<0.10; extra == "reflex"`. Update the sdist gate description (and reconcile the verifying script) so the documented window and its enforcement agree.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

except OSError as exc:
errors.append(f"cannot read project metadata for Reflex compatibility gate: {exc}")
else:
if f'"{REFLEX_REQUIREMENT}"' not in project_metadata:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The metadata check does not prove that xy[reflex] is bounded: an unrelated occurrence of the exact requirement anywhere in pyproject.toml can make it pass. Parsing project.optional-dependencies.reflex and validating that entry directly would ensure the published extra, not a decoy string, stays within the tested window.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/verify_ci_workflow.py, line 893:

<comment>The metadata check does not prove that `xy[reflex]` is bounded: an unrelated occurrence of the exact requirement anywhere in `pyproject.toml` can make it pass. Parsing `project.optional-dependencies.reflex` and validating that entry directly would ensure the published extra, not a decoy string, stays within the tested window.</comment>

<file context>
@@ -870,6 +872,29 @@ def validate_ci_workflow(path: Path = DEFAULT_CI_WORKFLOW) -> list[str]:
+    except OSError as exc:
+        errors.append(f"cannot read project metadata for Reflex compatibility gate: {exc}")
+    else:
+        if f'"{REFLEX_REQUIREMENT}"' not in project_metadata:
+            errors.append(
+                "pyproject.toml must bound the xy[reflex] extra to "
</file context>

'reflex-version: ["0.9.6", "0.9.8"]',
'reflex==${{ matrix.reflex-version }}',
"<0.10,>=0.9.6",
"test_component.py::test_component_compiles_with_events",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new Reflex compatibility gate can pass with no active Reflex install or smoke tests because it searches the raw job text, including comments and inactive YAML, rather than executable named steps. Structural checks of the install and smoke-test steps would keep CI from silently losing this coverage.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/verify_ci_workflow.py, line 885:

<comment>The new Reflex compatibility gate can pass with no active Reflex install or smoke tests because it searches the raw job text, including comments and inactive YAML, rather than executable named steps. Structural checks of the install and smoke-test steps would keep CI from silently losing this coverage.</comment>

<file context>
@@ -870,6 +872,29 @@ def validate_ci_workflow(path: Path = DEFAULT_CI_WORKFLOW) -> list[str]:
+        'reflex-version: ["0.9.6", "0.9.8"]',
+        'reflex==${{ matrix.reflex-version }}',
+        "<0.10,>=0.9.6",
+        "test_component.py::test_component_compiles_with_events",
+        "test_state_bridge.py::test_rebuild_reads_session_state",
+    )
</file context>

`METADATA` must keep `Name: xy`, `Requires-Python: >=3.11`,
`anywidget>=0.9`, and `numpy>=1.24` as base requirements, plus
`Provides-Extra: reflex` and `reflex>=0.9.6` guarded by that extra. The wheel
`Provides-Extra: reflex` and `reflex>=0.9.6,<0.10` guarded by that extra. The wheel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The new bounded Reflex contract (reflex>=0.9.6,<0.10) isn't propagated consistently in this file: the sdist release gate in the "Release-Blocking Gates" table (line ~92) still states the sdist PKG-INFO must include reflex>=0.9.6 with no upper bound, contradicting the window introduced here. The confirming gate code also still fullmatches the unbounded form: scripts/artifact_metadata.py _is_exact_reflex_extra uses re.fullmatch(r"\s*reflex\s*>=\s*0\.9\.6\s*;\s*extra...") with no ,<0.10, so it would reject the now-documented bounded Requires-Dist: reflex>=0.9.6,<0.10; extra == "reflex". Update the sdist gate description (and reconcile the verifying script) so the documented window and its enforcement agree.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At spec/process/production-readiness.md, line 395:

<comment>The new bounded Reflex contract (`reflex>=0.9.6,<0.10`) isn't propagated consistently in this file: the sdist release gate in the "Release-Blocking Gates" table (line ~92) still states the sdist `PKG-INFO` must include `reflex>=0.9.6` with no upper bound, contradicting the window introduced here. The confirming gate code also still fullmatches the unbounded form: `scripts/artifact_metadata.py` `_is_exact_reflex_extra` uses `re.fullmatch(r"\s*reflex\s*>=\s*0\.9\.6\s*;\s*extra...")` with no `,<0.10`, so it would reject the now-documented bounded `Requires-Dist: reflex>=0.9.6,<0.10; extra == "reflex"`. Update the sdist gate description (and reconcile the verifying script) so the documented window and its enforcement agree.</comment>

<file context>
@@ -392,7 +392,7 @@ Before tagging a release:
   `METADATA` must keep `Name: xy`, `Requires-Python: >=3.11`,
   `anywidget>=0.9`, and `numpy>=1.24` as base requirements, plus
-  `Provides-Extra: reflex` and `reflex>=0.9.6` guarded by that extra. The wheel
+  `Provides-Extra: reflex` and `reflex>=0.9.6,<0.10` guarded by that extra. The wheel
   must contain `reflex_xy` and `XYChart.jsx`, and `RECORD` must list every
   archive file exactly once with matching `sha256` and size fields. Wheels
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bound and test the supported Reflex compatibility window for xy[reflex]

1 participant